<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>gem5运行SPECCPU2017benchmark | Tom's develop Blog</title><meta name="keywords" content="gem5,GEM5,SPECCPU2017,spec,benchmark"><meta name="author" content="Tom"><meta name="copyright" content="Tom"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="如何在GEM5中运行SPECCPU 2017benchmark,实现两个平台的协同仿真">
<meta property="og:type" content="article">
<meta property="og:title" content="gem5运行SPECCPU2017benchmark">
<meta property="og:url" content="https://tomsworkspace.github.io/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/index.html">
<meta property="og:site_name" content="Tom&#39;s develop Blog">
<meta property="og:description" content="如何在GEM5中运行SPECCPU 2017benchmark,实现两个平台的协同仿真">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5运行SPECCPU2017benchmark/figure2.png">
<meta property="article:published_time" content="2020-10-11T07:39:06.000Z">
<meta property="article:modified_time" content="2021-06-12T11:29:07.711Z">
<meta property="article:author" content="Tom">
<meta property="article:tag" content="GEM5">
<meta property="article:tag" content="CPU2017">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5运行SPECCPU2017benchmark/figure2.png"><link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/avatar.png"><link rel="canonical" href="https://tomsworkspace.github.io/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="preconnect" href="//zz.bdstatic.com"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: Tom","link":"链接: ","source":"来源: Tom's develop Blog","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  ClickShowText: {"text":"富强,民主,文明,和谐,自由,平等,公正,法治,爱国,敬业,诚信,友善","fontSize":"15px"},
  lightbox: 'mediumZoom',
  Snackbar: undefined,
  justifiedGallery: {
    js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
    css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-06-12 19:29:07'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'true'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }})()</script><meta name="generator" content="Hexo 5.2.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/avator.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">38</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">73</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5运行SPECCPU2017benchmark/1.png)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Tom's develop Blog</a></span><span id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><span class="close" id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></span></span></nav><div id="post-info"><h1 class="post-title">gem5运行SPECCPU2017benchmark</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-10-11T07:39:06.000Z" title="发表于 2020-10-11 15:39:06">2020-10-11</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-06-12T11:29:07.711Z" title="更新于 2021-06-12 19:29:07">2021-06-12</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/GEM5/">GEM5</a></span></div><div class="meta-secondline"> <span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1.2k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>4分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/#post-comment"><span class="gitalk-comment-count comment-count"></span></a></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="系统环境配置"><a href="#系统环境配置" class="headerlink" title="系统环境配置"></a><strong>系统环境配置</strong></h2><p>&emsp;<strong>硬件：</strong></p>
<ul>
<li>CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz 4核 8 线程</li>
<li>内存16G</li>
<li>硬盘 2T HDD+512G SSD</li>
</ul>
<p>&emsp;<strong>软件：</strong></p>
<ul>
<li>Ubuntu 18.04 LTS</li>
<li>GCC/G++/FORTRAN 7.5.0</li>
<li>python 3.7.6</li>
<li>gem5 20.1.0.0</li>
</ul>
<h2 id="SPEC-CPU2017-benchmark"><a href="#SPEC-CPU2017-benchmark" class="headerlink" title="SPEC CPU2017 benchmark"></a><strong>SPEC CPU2017 benchmark</strong></h2><p><img src= "/img/loading.gif" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/figure1.png" alt="figure1.png"></p>
<p>&emsp; spec cpu2017 由43个benchmark组成，由20个整型和23个浮点benchmark组成。整型和浮点又分别有 吞吐量（Rate）和速度（Speed）两种类别的bench,分别用于测试 CPU的速度和吞吐量。将43个bench分为整型吞吐量（int_rate）、整型速度（int_speed）、浮点吞吐量（fp_rate）、浮点速度（fp_speed）四个类别。下面是对43个bench的具体介绍:</p>
<table>
<thead>
<tr>
<th align="left">SPECrate 2017 Integer</th>
<th align="left">SPECspeed 2017 Integer</th>
<th align="center">Language</th>
<th align="right">KLOC[1]</th>
<th align="left">应用领域</th>
</tr>
</thead>
<tbody><tr>
<td align="left">500.perlbench_r</td>
<td align="left">600.perlbench_s</td>
<td align="center">C</td>
<td align="right">362</td>
<td align="left">Perl编程语言解释器</td>
</tr>
<tr>
<td align="left">502.gcc_r</td>
<td align="left">602.gcc_s</td>
<td align="center">C</td>
<td align="right">1304</td>
<td align="left">GUN C编译器</td>
</tr>
<tr>
<td align="left">505.mcf_r</td>
<td align="left">605.mcf_s</td>
<td align="center">C</td>
<td align="right">3</td>
<td align="left">路径规划</td>
</tr>
<tr>
<td align="left">520.omnetpp_r</td>
<td align="left">620.omnetpp_s</td>
<td align="center">C++</td>
<td align="right">134</td>
<td align="left">离散事件模拟-计算机网络</td>
</tr>
<tr>
<td align="left">523.xalancbmk_r</td>
<td align="left">623.xalancbmk_s</td>
<td align="center">C++</td>
<td align="right">520</td>
<td align="left">XSLT将XML转化为HTML</td>
</tr>
<tr>
<td align="left">525.x264_r</td>
<td align="left">625.x264_s</td>
<td align="center">C</td>
<td align="right">96</td>
<td align="left">视频压缩</td>
</tr>
<tr>
<td align="left">531.deepsjeng_r</td>
<td align="left">631.deepsjeng_s</td>
<td align="center">C++</td>
<td align="right">10</td>
<td align="left">人工智能：alpha-beta数搜索（国际象棋）</td>
</tr>
<tr>
<td align="left">541.leela_r</td>
<td align="left">641.leela_s</td>
<td align="center">C++</td>
<td align="right">21</td>
<td align="left">人工智能：蒙特卡洛述搜索（围棋）</td>
</tr>
<tr>
<td align="left">548.exchange2_r</td>
<td align="left">648.exchange2_s</td>
<td align="center">Fortran</td>
<td align="right">1</td>
<td align="left">人工智能：递归解决方案生成器（数独）</td>
</tr>
<tr>
<td align="left">557.xz_r</td>
<td align="left">657.xz_s</td>
<td align="center">C</td>
<td align="right">33</td>
<td align="left">通用数据压缩</td>
</tr>
</tbody></table>
<table>
<thead>
<tr>
<th align="left">SPECrate 2017 Integer</th>
<th align="left">SPECspeed 2017 Integer</th>
<th align="center">Language</th>
<th align="right">KLOC[1]</th>
<th align="left">应用领域</th>
</tr>
</thead>
<tbody><tr>
<td align="left">503.bwaves_r</td>
<td align="left">603.bwaves_s</td>
<td align="center">Fortran</td>
<td align="right">1</td>
<td align="left">爆炸模型</td>
</tr>
<tr>
<td align="left">507.cactuBSSN_r</td>
<td align="left">607.cactuBSSN_s</td>
<td align="center">C++ C Fortran</td>
<td align="right">257</td>
<td align="left">物理：相对论</td>
</tr>
<tr>
<td align="left">508.namd_r</td>
<td align="left"></td>
<td align="center">C++</td>
<td align="right">8</td>
<td align="left">分子动力学</td>
</tr>
<tr>
<td align="left">510.parest_r</td>
<td align="left"></td>
<td align="center">C++</td>
<td align="right">427</td>
<td align="left">生物医学成像</td>
</tr>
<tr>
<td align="left">511.povray_r</td>
<td align="left"></td>
<td align="center">C++ C</td>
<td align="right">170</td>
<td align="left">光学追踪</td>
</tr>
<tr>
<td align="left">519.lbm_r</td>
<td align="left">619.lbm_s</td>
<td align="center">C</td>
<td align="right">1</td>
<td align="left">流体动力学</td>
</tr>
<tr>
<td align="left">521.wrf_r</td>
<td align="left">621.wrf_s</td>
<td align="center">Fortran C</td>
<td align="right">991</td>
<td align="left">天气预报</td>
</tr>
<tr>
<td align="left">526.blender_r</td>
<td align="left"></td>
<td align="center">C++ C</td>
<td align="right">1577</td>
<td align="left">3D动画渲染</td>
</tr>
<tr>
<td align="left">527.cam4_r</td>
<td align="left">627.cam4_s</td>
<td align="center">Fortran C</td>
<td align="right">407</td>
<td align="left">大气建模</td>
</tr>
<tr>
<td align="left"></td>
<td align="left">628.pop2_s</td>
<td align="center">Fortran C</td>
<td align="right">338</td>
<td align="left">大规模海洋模拟（气候水平）</td>
</tr>
<tr>
<td align="left">538.imagick_r</td>
<td align="left">638.imgick_s</td>
<td align="center">C</td>
<td align="right">259</td>
<td align="left">图像处理</td>
</tr>
<tr>
<td align="left">544.nab_r</td>
<td align="left">644.nab_s</td>
<td align="center">C</td>
<td align="right">24</td>
<td align="left">分子动力学</td>
</tr>
<tr>
<td align="left">549.fotonik3d_r</td>
<td align="left">649.fotonik3d_s</td>
<td align="center">Fortran</td>
<td align="right">14</td>
<td align="left">计算电磁学</td>
</tr>
<tr>
<td align="left">554.roms_r</td>
<td align="left">654.roms_s</td>
<td align="center">Fortran</td>
<td align="right">210</td>
<td align="left">区域海洋模拟</td>
</tr>
</tbody></table>
<p>[1]KLOC=编译时使用的源码长度（包括空格和注释）/1000</p>
<h2 id="编译运行"><a href="#编译运行" class="headerlink" title="编译运行"></a><strong>编译运行</strong></h2><p>&emsp;<strong>（1）spec cpu 2017编译</strong></p>
<p>&emsp;主要按照<a target="_blank" rel="noopener" href="https://www.spec.org/cpu2017/Docs/quick-start.html">官方文档</a>的说明。</p>
<p>&emsp;<strong>（2）gem5的安装运行</strong></p>
<p>&emsp;<a target="_blank" rel="noopener" href="http://www.gem5.org/documentation/learning_gem5/part1/building/">官方文档</a></p>
<p>&emsp;<strong>(3)自动化脚本</strong></p>
<p>&emsp;关于43个benmark的输入数据及命令格式：<a target="_blank" rel="noopener" href="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/SPEC2017_commands.pdf">SPEC CPU2017 commands</a><br>&emsp;其他更多细节也可参照我之前的文章，<a href="https://tomsworkspace.github.io/2020/09/22/gem5%E8%BF%90%E8%A1%8CSPECCPU2006benchmark/">在GME5运行SPEC CPU 2006 benchmark</a> <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_38877888/article/details/108759538">CSDN链接</a></p>
<h2 id="协同仿真"><a href="#协同仿真" class="headerlink" title="协同仿真"></a><strong>协同仿真</strong></h2><p>&emsp;目前已经成功编译并运行大部分bench，但是还有3个bench编译成功但是无法正常运行。具体如下：</p>
<table>
<thead>
<tr>
<th align="center">BENCHMARK</th>
<th align="left">错误原因</th>
</tr>
</thead>
<tbody><tr>
<td align="center">510.parest_r</td>
<td align="left">An error occurred in line &lt;377&gt; of file &lt;source/base/utilities.cc&gt; in    function                                                                           The violated condition was: cpuinfo                                                                            The name and call sequence of the exception was: ExcIO()</td>
</tr>
<tr>
<td align="center">527.cam4_r</td>
<td align="left">At line 869 of file shr_file_mod.fppized.f90 (unit = 98) Fortran runtime error: Cannot open file ‘cpl_modelio.nml’: No such file or directory</td>
</tr>
<tr>
<td align="center">627.cam4_s</td>
<td align="left">At line 869 of file shr_file_mod.fppized.f90 (unit = 98) Fortran runtime error: Cannot open file ‘cpl_modelio.nml’: No such file or directory</td>
</tr>
</tbody></table>
<h2 id="主要问题"><a href="#主要问题" class="headerlink" title="主要问题"></a><strong>主要问题</strong></h2><h3 id="（1）spec-cpu-2017-编译错误"><a href="#（1）spec-cpu-2017-编译错误" class="headerlink" title="（1）spec cpu 2017 编译错误"></a>（1）spec cpu 2017 编译错误</h3><p>&emsp;主要可能导致的原因如下：</p>
<ul>
<li>gcc/g++/gfortran 路径错误，从提供的配置文件直接拷贝时需要修改一下编译工具链的路径。</li>
<li>优化选项导致的错误，比如-fno-tree-loop-vectorize优化选项，将其去掉。</li>
</ul>
<h3 id="（2）protobuf导致的gem5编译错误"><a href="#（2）protobuf导致的gem5编译错误" class="headerlink" title="（2）protobuf导致的gem5编译错误"></a>（2）protobuf导致的gem5编译错误</h3><p>&emsp;主要可能导致的原因如下：</p>
<ul>
<li>protocbuf版本太低或者太高</li>
<li>系统中存在多个版本的protobuf</li>
</ul>
<p>&emsp;由于protobuf会被在很多地方采用(如python），所以系统中可能存在多个版本的protocbuf。导致编译时使用了不同版本的库或工具导致编译出错。编译时可以从这个思路排查。可以卸载其他版本的protobuf或者使用源码编译安装。如果实在无法解决问题，可以修改gem5安装目录下的SConstruct文件禁用protobuf组件或卸载protobuf可以使编译通过，这不会影响gem5的主要功能。</p>
<h3 id="（3）panic-Unrecognized-instruction-executed"><a href="#（3）panic-Unrecognized-instruction-executed" class="headerlink" title="（3）panic Unrecognized instruction executed"></a>（3）panic Unrecognized instruction executed</h3><figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">panic: Unrecognized/invalid instruction executed:</span><br><span class="line">&#123;</span><br><span class="line">    leg = 0x10,</span><br><span class="line">    rex = 0,</span><br><span class="line">    vex/xop = 0x5,</span><br><span class="line">    op = &#123;</span><br><span class="line">        <span class="built_in">type</span> = three byte 0f3a,</span><br><span class="line">        op = 0x18,</span><br><span class="line">    &#125;,</span><br><span class="line">    modRM = 0,</span><br><span class="line">    sib = 0,</span><br><span class="line">    immediate = 0,</span><br><span class="line">    displacement = 0</span><br><span class="line">    dispSize = 0</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>&emsp;这个问题出现在使用Gem5运行spec cpu 2017 的 benchmark时，出现错误的原因主要是cpu2017的benchmark编译时生成的代码指令中包含gem5目前不支持的无效指令，很可能是SSE或AVX指令。这个问题可以通过在cpu 2017的配置文件中加上<a target="_blank" rel="noopener" href="https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html">-march选项</a>来生成支持的代码指令。</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line"><span class="comment">#vim your-cpu2017-config.cfg</span></span><br><span class="line"></span><br><span class="line">default=base:         <span class="comment"># flags for all base</span></span><br><span class="line">   OPTIMIZE       = -g -O3 -march=x86-64 -fno-unsafe-math-optimizations</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>&emsp;参考<br>[1]<a target="_blank" rel="noopener" href="https://gem5-users.gem5.narkive.com/jO22f7kV/spec2017-on-gem5-se-mode#post5">https://gem5-users.gem5.narkive.com/jO22f7kV/spec2017-on-gem5-se-mode#post5</a><br>[2]<a target="_blank" rel="noopener" href="https://www.mail-archive.com/gem5-dev@gem5.org/msg28987.html">https://www.mail-archive.com/gem5-dev@gem5.org/msg28987.html</a><br>[3]<a target="_blank" rel="noopener" href="https://www.mail-archive.com/gem5-users@gem5.org/msg14911.html">https://www.mail-archive.com/gem5-users@gem5.org/msg14911.html</a></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Tom</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://tomsworkspace.github.io/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/">https://tomsworkspace.github.io/2020/10/11/gem5%E8%BF%90%E8%A1%8CSPECCPU2017benchmark/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://TOMsworkspace.github.io" target="_blank">Tom's develop Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/GEM5/">GEM5</a><a class="post-meta__tags" href="/tags/CPU2017/">CPU2017</a></div><div class="post_share"><div class="social-share" data-image="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/10/11/gem5运行SPECCPU2017benchmark/figure2.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏<div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/wp.jpg" target="_blank"><img class="post-qr-code-img" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/wp.jpg" alt="wechat"/></a><div class="post-qr-code-desc">wechat</div></li></ul></div></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/11/23/C++%E8%AF%AD%E8%A8%80%E6%A0%87%E5%87%86/"><img class="prev-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io//2020/11/23/C++语言标准/figure1.jpg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">C++语言标准</div></div></a></div><div class="next-post pull-right"><a href="/2020/09/26/C++%E5%A4%9A%E7%BB%A7%E6%89%BF%E6%97%B6%E7%9A%84%E8%99%9A%E5%87%BD%E6%95%B0%E8%A1%A8%E7%BB%93%E6%9E%84/"><img class="next-cover" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/26/C++多继承时的虚函数表结构/figure1.jpg" onerror="onerror=null;src='/img/404.jpg'"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">C++多继承时的虚函数表结构</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2020/09/22/gem5运行SPECCPU2006benchmark/" title="gem5运行SPECCPU2006benchmark"><img class="cover" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2020/09/22/gem5运行SPECCPU2006benchmark/figure2.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-09-22</div><div class="title">gem5运行SPECCPU2006benchmark</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="gitalk-container"></div></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/BlogHelper@1.0/avator.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">Tom</div><div class="author-info__description">keep curiously!</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">38</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">73</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/TOMsworkspace"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/TOMsworkspace" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:cqucscw@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%B3%BB%E7%BB%9F%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE"><span class="toc-number">1.</span> <span class="toc-text">系统环境配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#SPEC-CPU2017-benchmark"><span class="toc-number">2.</span> <span class="toc-text">SPEC CPU2017 benchmark</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8C"><span class="toc-number">3.</span> <span class="toc-text">编译运行</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8D%8F%E5%90%8C%E4%BB%BF%E7%9C%9F"><span class="toc-number">4.</span> <span class="toc-text">协同仿真</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E8%A6%81%E9%97%AE%E9%A2%98"><span class="toc-number">5.</span> <span class="toc-text">主要问题</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%EF%BC%881%EF%BC%89spec-cpu-2017-%E7%BC%96%E8%AF%91%E9%94%99%E8%AF%AF"><span class="toc-number">5.1.</span> <span class="toc-text">（1）spec cpu 2017 编译错误</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%EF%BC%882%EF%BC%89protobuf%E5%AF%BC%E8%87%B4%E7%9A%84gem5%E7%BC%96%E8%AF%91%E9%94%99%E8%AF%AF"><span class="toc-number">5.2.</span> <span class="toc-text">（2）protobuf导致的gem5编译错误</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%EF%BC%883%EF%BC%89panic-Unrecognized-instruction-executed"><span class="toc-number">5.3.</span> <span class="toc-text">（3）panic Unrecognized instruction executed</span></a></li></ol></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2021/09/27/%E6%B5%81%E4%BD%93%E6%A8%A1%E6%8B%9F%E4%B8%8ESPH%E6%96%B9%E6%B3%95/" title="流体模拟与SPH方法"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/09/27/流体模拟与SPH方法/figure1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="流体模拟与SPH方法"/></a><div class="content"><a class="title" href="/2021/09/27/%E6%B5%81%E4%BD%93%E6%A8%A1%E6%8B%9F%E4%B8%8ESPH%E6%96%B9%E6%B3%95/" title="流体模拟与SPH方法">流体模拟与SPH方法</a><time datetime="2021-09-27T08:46:17.000Z" title="发表于 2021-09-27 16:46:17">2021-09-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/09/11/%E5%BC%B9%E6%80%A7%E6%9C%89%E9%99%90%E5%85%83%E6%96%B9%E6%B3%95/" title="弹性有限元方法"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/09/11/弹性有限元方法/figure1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="弹性有限元方法"/></a><div class="content"><a class="title" href="/2021/09/11/%E5%BC%B9%E6%80%A7%E6%9C%89%E9%99%90%E5%85%83%E6%96%B9%E6%B3%95/" title="弹性有限元方法">弹性有限元方法</a><time datetime="2021-09-11T09:05:34.000Z" title="发表于 2021-09-11 17:05:34">2021-09-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/08/09/%E5%BC%B9%E7%B0%A7%E8%B4%A8%E7%82%B9%E7%B3%BB%E7%BB%9F%E4%B8%8E%E6%97%B6%E9%97%B4%E7%A7%AF%E5%88%86/" title="弹簧质点系统与时间积分"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/08/09/弹簧质点系统与时间积分/figure1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="弹簧质点系统与时间积分"/></a><div class="content"><a class="title" href="/2021/08/09/%E5%BC%B9%E7%B0%A7%E8%B4%A8%E7%82%B9%E7%B3%BB%E7%BB%9F%E4%B8%8E%E6%97%B6%E9%97%B4%E7%A7%AF%E5%88%86/" title="弹簧质点系统与时间积分">弹簧质点系统与时间积分</a><time datetime="2021-08-09T13:39:12.000Z" title="发表于 2021-08-09 21:39:12">2021-08-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/08/08/OpenGL%E5%9D%90%E6%A0%87%E7%B3%BB%E7%BB%9F/" title="OpenGL坐标系统"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/08/08/OpenGL坐标系统/figure1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="OpenGL坐标系统"/></a><div class="content"><a class="title" href="/2021/08/08/OpenGL%E5%9D%90%E6%A0%87%E7%B3%BB%E7%BB%9F/" title="OpenGL坐标系统">OpenGL坐标系统</a><time datetime="2021-08-08T12:57:28.000Z" title="发表于 2021-08-08 20:57:28">2021-08-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2021/08/06/Doxygen%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E6%96%87%E6%A1%A3/" title="Doxygen自动生成文档"><img data-lazy-src="https://cdn.jsdelivr.net/gh/TOMsworkspace/TOMsworkspace.github.io/2021/08/06/Doxygen自动生成文档/Doxygen.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Doxygen自动生成文档"/></a><div class="content"><a class="title" href="/2021/08/06/Doxygen%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E6%96%87%E6%A1%A3/" title="Doxygen自动生成文档">Doxygen自动生成文档</a><time datetime="2021-08-06T13:24:50.000Z" title="发表于 2021-08-06 21:24:50">2021-08-06</time></div></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2021 By Tom</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a href="https://TOMsworkspace.github.io/">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog"></i></button><button id="chat_btn" type="button" title="rightside.chat_btn"><i class="fas fa-sms"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module" defer></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><div class="js-pjax"><script>if (!window.MathJax) {
  window.MathJax = {
    loader: {
      source: {
        '[tex]/amsCd': '[tex]/amscd'
      }
    },
    tex: {
      inlineMath: [ ['$','$'], ["\\(","\\)"]],
      tags: 'ams'
    },
    options: {
      renderActions: {
        findScript: [10, doc => {
          for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
            const display = !!node.type.match(/; *mode=display/)
            const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
            const text = document.createTextNode('')
            node.parentNode.replaceChild(text, node)
            math.start = {node: text, delim: '', n: 0}
            math.end = {node: text, delim: '', n: 0}
            doc.math.push(math)
          }
        }, ''],
        addClass: [200,() => {
          document.querySelectorAll('mjx-container:not([display=\'true\']').forEach( node => {
            const target = node.parentNode
            if (!target.classList.contains('has-jax')) {
              target.classList.add('mathjax-overflow')
            }
          })
        }, '', false]
      }
    }
  }
  
  const script = document.createElement('script')
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
  script.id = 'MathJax-script'
  script.async = true
  document.head.appendChild(script)
} else {
  MathJax.startup.document.state(0)
  MathJax.texReset()
  MathJax.typeset()
}</script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"><script src="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css"><script>$(function () {
  $('span.katex-display').wrap('<div class="katex-wrap"></div>')
})</script><script>function addGitalkSource () {
  const ele = document.createElement('link')
  ele.rel = 'stylesheet'
  ele.href= 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css'
  document.getElementsByTagName('head')[0].appendChild(ele)
}

function loadGitalk () {
  function initGitalk () {
    var gitalk = new Gitalk({
      clientID: 'e50742231659674c31e3',
      clientSecret: '59038139e289bc384e484d341205bbb95a123209',
      repo: 'TOMsworkspace.github.io',
      owner: 'TOMsworkspace',
      admin: ['TOMsworkspace'],
      id: 'ba15b64c1ff9c936e96a1c0cfbf8cbc7',
      language: '-zh-CN# en, zh-CN, zh-TW, es-ES, fr, ru',
      perPage: 10,
      distractionFreeMode: false,
      pagerDirection: 'last',
      createIssueManually: true,
      updateCountCallback: commentCount
    })
    gitalk.render('gitalk-container')
  }

  if (typeof Gitalk === 'function') initGitalk()
  else {
    addGitalkSource()
    $.getScript('https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js', initGitalk)
  }
}

function commentCount(n){
  let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
  if (isCommentCount) {
    isCommentCount.innerHTML= n
  }
}

if ('Gitalk' === 'Gitalk' || !false) {
  if (false) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
  else loadGitalk()
} else {
  function loadOtherComment () {
    loadGitalk()
  }
}</script><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" async="async" mobile="false"></script><script>(function(){
  const bp = document.createElement('script');
  const curProtocol = window.location.protocol.split(':')[0];
  if (curProtocol === 'https'){
  bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
  bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
  bp.dataset.pjax = ''
  const s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(bp, s);
})()</script></div></body></html>